package com.zjitc.redis;

import com.zjitc.common.redis.MyRedisPool;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisCommands;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/10 15:05
 * @description:
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:application-config.xml"})
public class TEST {

@Autowired
private MyRedisPool pool;

  @Test
  public void redispoolTest(){
    JedisPool pool = new JedisPool();
    Jedis jedis = pool.getResource();
    pool.close();
  }


  @Test
  public void t1(){
    Long sadd = pool.addSet("user", "name1", "name2");
    System.out.println(sadd);
  }


}
